﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using OpalisConsole.Class;
using OpalisConsole.Views.User_Imaging.Child_Windows;
namespace OpalisConsole
{
    public partial class SchedulingWindow : ChildWindow
    {
        public SchedulingWindow(List<TimeSlot> TimeList, int selectedIndex)
        {
            InitializeComponent();
            timeGrid.ItemsSource = TimeList;
            timeGrid.SelectedIndex = selectedIndex;
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if (!((TimeSlot)timeGrid.SelectedItem).Available)
            {
                MessageWindow window = new MessageWindow("Please select an available Timeslot");
                window.Show();
            }
            else
            {
                this.DialogResult = true;
            }
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}

